# 四个方向的三角形
n = 5  # 三角形的高度

print("向上的直角三角形:")
i = 1
while i <= n:
    print("*" * i)
    i += 1

print("\n向下的直角三角形:")
i = n
while i > 0:
    print("*" * i)
    i -= 1

print("\n向左的直角三角形:")
i = 1
while i <= n:
    print(" " * (n - i) + "*" * i)
    i += 1

print("\n向右的直角三角形:")
i = 1
while i <= n:
    print("*" * i + " " * (n - i))
    i += 1
